﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using TouchControls.Pivot;
    
namespace TouchControls
{
    public partial class TouchPivot
    {
        public int SelectedIndex
        {
            get { return (int)GetValue(SelectedIndexProperty); }
            set
            {
                //SetValue(SelectedIndexProperty, value);
                if (value != SelectedIndex)
                    this.ScrollTo(value);
            }
        }

        public delegate void SelectedItemChangedHandler(object sender, PivotItemEventArgs arg);

        public event SelectedItemChangedHandler SelectedItemChanged;

        // Using a DependencyProperty as the backing store for SelectedIndex.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty SelectedIndexProperty =
            DependencyProperty.Register("SelectedIndex", typeof(int), typeof(TouchPivot), new PropertyMetadata(0));

        private PivotHeader SelectedHeader
        {
            get
            {                
                return ((PivotItem)Items[SelectedIndex]).Header;
            }
        }



        public double TitleSize
        {
            get { return (double)GetValue(TitleSizeProperty); }
            set { SetValue(TitleSizeProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TitleSize.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TitleSizeProperty =
            DependencyProperty.Register("TitleSize", typeof(double), typeof(TouchPivot), new PropertyMetadata(38.0));




        public UIElement HeaderPlaceholder
        {
            get { return (UIElement)GetValue(HeaderPlaceholderProperty); }
            set { SetValue(HeaderPlaceholderProperty, value); }
        }

        // Using a DependencyProperty as the backing store for HeaderPlaceholder.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty HeaderPlaceholderProperty =
            DependencyProperty.Register("HeaderPlaceholder", typeof(UIElement), typeof(TouchPivot), null);



        public double HeaderHeight
        {
            get { return (double)GetValue(HeaderHeightProperty); }
            set { SetValue(HeaderHeightProperty, value); }
        }

        // Using a DependencyProperty as the backing store for HeaderHeight.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty HeaderHeightProperty =
            DependencyProperty.Register("HeaderHeight", typeof(double), typeof(TouchPivot), new PropertyMetadata(55.0));

        
    }
}
